﻿using AutoMapper;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SY.BasicData.Api.Write.Basic.Applications.Slaughter.Command;
using SY.BasicData.ErrorCode;

namespace SY.BasicData.Api.Write.Controllers
{
    /// <summary>
    /// 屠杀信息表
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class WriteSlaughterController : ControllerBase
    {
        private readonly IMediator mediator;
        private readonly ILogger<WriteSlaughterController> logger;

        public WriteSlaughterController(IMediator mediator, ILogger<WriteSlaughterController> logger)
        {
            this.mediator = mediator;
            this.logger = logger;
        }
        /// <summary>
        /// 修改屠杀信息
        /// </summary>
        /// <param name="command">命令</param>
        /// <returns>返回信息</returns>
        /// 

        [HttpPost]
        public async Task<ApiResult<int>> UpdateSlaughter(UpdateSlaughterCommand command)
        {
            return await mediator.Send(command);
        }
    }
}
